<script type="hidden/javascript">
	$(document).ready(function() {
	});

	function laporan(pageURL, title,w,h){

		var periode_awal=document.getElementById('tanggal_awal').value;

		var periode_akhir=document.getElementById('tanggal_akhir').value;

		if ((periode_awal=='')||(periode_akhir=='')){

			alert('Isilah periode awal dan akhir');

		}else{

			var left = (screen.width/2)-(w/2);

			var top = (screen.height/2)-(h/2);

			var targetWin = window.open ('<?=site_url();?>/mcm/view_lap_biaya_periode/'+periode_awal+'/'+periode_akhir, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);

			

			document.getElementById('tanggal_awal').value='';

			document.getElementById('tanggal_akhir').value='';

		}
	}

	

	$(function(){

		$("#tanggal_awal").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

	$(function(){

		$("#tanggal_akhir").datepicker({dateFormat: 'yy-mm-dd' });

	})	

	

		

	function klick_tanggal_awal(){

		var tanggal = document.getElementById("tanggal_awal");

		tanggal.focus();

	}

	

	function klick_tanggal_akhir(){

		var tanggal = document.getElementById("tanggal_akhir");

		tanggal.focus();

	}

	

	function batal2(){
 
		$.fancybox.close();
		 
	}
 
</script>


	<?php 
		if(validation_errors())
		{
	?>
			<ul class="message error grid_12">
				<li><?=validation_errors()?></li>
				<li class="close-bt"></li>
			</ul>	
	<?php
		} 
	?>
<div id="page-heading"><h1>Verifikasi Data Mandiri Cash Management</h1></div>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td> 
		<div id="content-table-inner">
		<table border="0" width="100%" cellpadding="0" cellspacing="0">
		
		<tr valign="top">
			<td>				 
			<?php 
				$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
				echo form_open_multipart('mcm/process_update', $attributes);
			?>
			 
			<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">	
				 
				<tbody>
				 <? //echo "<input type='hidden' name='count_result'  id='count_result' value='".$count_result ."'>"?> 
				<tr>
					<td>GLID</td>  
					<td>
						<?=$glid?><br/>
					</td>
				</tr>
				<?php 
				$i=0;
				foreach($results->result() as $row) 
				{
				$i=$i+1;
				?>
				<!--
				<tr>
					<td>ID</td>  
					<td>
						<?=$row->id?><br/>
						<? echo "<input type='hidden' name='id'  id='id' value='".$row->id ."'>"?>
					</td>
				</tr>
				-->
				<? echo "<input type='hidden' name='id'  id='id' value='".$row->id ."'>"?>
				<tr>
					<td>ID MCM</td>  
					<td> 
						<?=$row->id_mcm?><br/>
						<? echo "<input type='hidden' name='id_mcm'  id='id_mcm' value='".$row->id_mcm ."'>"?>
					</td>
				</tr>
				<tr>
					<td>Tanggal Pemasukkan</td> 
					<td>
						<?php $tgl1=$tanggal 	= date('d-M-Y', strtotime($row->tanggal));?> <?=$tgl1?> <br/>
						<? echo "<input type='hidden' name='tanggal'  id='tanggal' value='".$row->tanggal ."'>"?>
					</td>
				</tr>
				<tr>
					<td>Tanggal Transaksi</td> 
					<td>
						<?php $now = date('Y-m-d'); $tgl2= date('d-M-Y');   ?> <?=$tgl2?> <br/>
						<? echo "<input type='hidden' name='tanggal_trans'  id='tanggal_trans' value='".$now ."'>"?>
					</td>
				</tr>
				<tr>
					<td>Rincian Transaksi</td>   
					<td>
						<?=$row->rincian_transaksi?><br/>
						<? echo "<input type='hidden'   name='rincian_transaksi'  id='rincian_transaksi' value='".$row->rincian_transaksi."'>"?>
					</td>
				</tr>
				<tr>
					<td>Debet</td>  
					<td>
						<?=convert_rupiah_non_rp($row->debet)?> <br/>
						<? echo "<input type='hidden' style='hidden-align:right' name='debet'  id='debet' value='".$row->debet ."' readonly='readonly' >";?>  
					</td>
				</tr>
				<tr>
					<td>Kredit</td>  
					<td>
						<?=convert_rupiah_non_rp($row->kredit)?> <br/>
						<? echo "<input type='hidden' style='hidden-align:right' name='kredit'  id='kredit' value='".$row->kredit ."' readonly='readonly' >";?>  
					</td>
				</tr>
				<tr>
					<td>Uraian</td>  
					<td> 
						<? echo "<textarea  cols='30' rows='3' name='uraian'  id='uraian' >".$row->uraian ."</textarea>"?>
					</td>
				</tr>
				<tr>
				
				  
					<td>Kas <br/>(Akun kepala 1)</td>  
					<td> 
					 
							<select <? echo " name='kas' id='kas' "?> >
								 
									<?
									 
										echo "<option  value=''>Pilih Kategori</option>";
										$sql = mysql_query("SELECT * from master_akun where akunid like '1%' ORDER BY akunid ASC");
										while($p=mysql_fetch_array($sql))
										{
											$sel = ($p['akunid'] == $row->pendapatan)? "selected" : "";
											echo "<option value=\"".$p['akunid']."\" $sel>".$p['akunid'].'-'.$p['nakun']."</option>";
										}
									 
									?>
						</select> 
					</td>
				</tr>
				<tr>
					<td>Pendapatan<br/> (Akun Kepala 4)</td>  
					<td>
						<?=$row->pendapatan?><br/>
							<select <? echo " name='pendapatan' id='pendapatan' "?> >
								 
									<?
									if($row->status == 'posting')
									{ 
										$sql = mysql_query("SELECT * from master_akun where akunid like '4%' and akunid = $row->pendapatan ORDER BY akunid ASC");
										while($p=mysql_fetch_array($sql))
										{
											$sel = ($p['akunid'] == $row->pendapatan)? "selected" : "";
											echo "<option value=\"".$p['akunid']."\" $sel>".$p['akunid'].'-'.$p['nakun']."</option>";
										}
										 
									} 
									else
									{
										echo "<option  value=''>Pilih Kategori</option>";
										$sql = mysql_query("SELECT * from master_akun where akunid like '4%' ORDER BY akunid ASC");
										while($p=mysql_fetch_array($sql))
										{
											$sel = ($p['akunid'] == $row->pendapatan)? "selected" : "";
											echo "<option value=\"".$p['akunid']."\" $sel>".$p['akunid'].'-'.$p['nakun']."</option>";
										}
									}
									?>
						</select>
					</td>
				</tr>
				<tr>
					<td>Parawaba</td>  
					<td>
						<?=$row->parawaba?><br/>
							<select <? echo " name='parawaba' id='parawaba' "?> >
									<?
									if($row->status == 'posting')
									{ 
										if(($row->parawaba == '0')or($row->parawaba == ''))
										{ 
											echo "<option  value='0'>--Pilih Parawaba--</option>";
											$sql = mysql_query("SELECT * FROM master_parawaba ORDER BY nama ASC");
											while($p=mysql_fetch_array($sql))
											{
												$sel = ($p['id'] == $row->parawaba)? "selected" : "";
												echo "<option value=\"".$p['id']."\" $sel>".$p['nama']."</option>";
											}
										}
										else
										{
											$sql = mysql_query("SELECT * FROM master_parawaba where id = $row->parawaba");
											while($p=mysql_fetch_array($sql))
											{
												$sel = ($p['id'] == $row->parawaba)? "selected" : "";
												echo "<option value=\"".$p['id']."\" $sel>".$p['nama']."</option>";
											}
										}
									} 
									else
									{
										echo "<option  value='0'>--Pilih Parawaba--</option>";
										$sql = mysql_query("SELECT * FROM master_parawaba ORDER BY nama ASC");
										while($p=mysql_fetch_array($sql))
										{
											$sel = ($p['id'] == $row->parawaba)? "selected" : "";
											echo "<option value=\"".$p['id']."\" $sel>".$p['nama']."</option>";
										}
									}
									?>
							</select>
					</td>
				</tr>
				
				 
				 
				<?php } ?>	
				</tbody> 
				</table> 
				 
				
				
				<input type="submit" value="Simpan" class="form-submit" />
				<input type="reset" value="Batal" class="form-reset" onclick="javascript:batal2();" /> 
				</form>		
				
		</div>
		</td>
		</tr> 		 
	</div> 
	</td>
</tr>
</table>
 
		 
		
<div class="clear"></div>
 

</div>	
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>
 


			